from selenium.webdriver.common.by import By

from page_objects.base_page import BasePage


class HomePage(BasePage):
    __MANAGER = (By.XPATH, '//span[contains(text(),"商品管理")]')
    __LIST = (By.XPATH, '//span[contains(text(),"商品列表")]')
    def go_to_category(self):
        """系统首页：进入商品商品"""
        # 点击菜单“商场管理”
        self.do_find(self.__MANAGER).click()
        # 点击菜单“商品商品”
        self.do_find(self.__LIST).click()
        # ==》商品列表页面
        from page_objects.category_list_page import CategoryListPage
        return CategoryListPage(self.driver)